/**
 * Created by meiguizhinian on 2018/6/26
 * Copyright © 2018 lixiaolong. All rights reserved.
 */

//单例/全静态
ivy.CocosActionCreater = {
	_customActionFunc: null,

	getInstance : function() {
		return this;
	},

	init: function () {
		let cadm = ivy.CocosActionDataManager.getInstance();
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Sequence, function(actionData, actionVector){
			return cc.sequence(actionVector);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Spawn,  function(actionData, actionVector) {
			return cc.spawn(actionVector);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RepeatForEver, function(actionData, actionVector) {
			return cc.repeatForever(actionVector[0]);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Repeat, function(actionData, actionVector) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Repeat_Time_int]);
			return cc.repeat(actionVector[0], v1);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_MoveTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_MoveBy_Time_float]);
			let v2 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_MoveBy_Position_vec2]);
			return cc.moveTo(v1, v2);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_MoveBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_MoveBy_Time_float]);
			let v2 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_MoveBy_Position_vec2]);
			return cc.moveBy(v1, v2);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_ScaleTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ScaleTo_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ScaleTo_XValue_float]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ScaleTo_YValue_float]);
			return cc.scaleTo(v1, v2, v3);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_ScaleBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ScaleTo_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ScaleTo_XValue_float]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ScaleTo_YValue_float]);
			return cc.scaleBy(v1, v2, v3);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RotateTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_RotateTo_Time_float]);
			let v2 = cadm.getVec3DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_RotateTo_RotateValue_vec3]);
			if (cc.sys.isNative) {
				return cc.rotateTo(v1, v2);
			} else {
				return cc.rotateTo(v1, v2.x, v2.y);
			}
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RotateBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_RotateBy_Time_float]);
			let v2 = cadm.getVec3DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_RotateBy_RotateValue_vec3]);
			if (cc.sys.isNative) {
				return cc.rotateBy(v1, v2);
			} else {
				return cc.rotateBy(v1, v2.x, v2.y);
			}
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_SkewTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_SkewTo_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_SkewTo_XAngle_float]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_SkewTo_YAngle_float]);
			return cc.skewTo(v1, v2, v3);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_SkewBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_SkewBy_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_SkewBy_XAngle_float]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_SkewBy_YAngle_float]);
			return cc.skewBy(v1, v2, v3);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_JumpTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpTo_Time_float]);
			let v2 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpTo_Position_vec2f]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpTo_Height_float]);
			let v4 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpTo_JumpCount_int]);
			return cc.jumpTo(v1, v2, v3, v4);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_JumpBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpBy_Time_float]);
			let v2 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpBy_Position_vec2f]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpBy_Height_float]);
			let v4 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_JumpBy_JumpCount_int]);
			return cc.jumpBy(v1, v2, v3, v4);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_BezierTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierTo_Time_float]);
			let v2 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierTo_ControlPoint1_vec2f]);
			let v3 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierTo_ControlPoint2_vec2f]);
			let v4 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierTo_EndPoint_vec2f]);
			return cc.bezierTo(v1, [v2, v3, v4]);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_BezierBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierBy_Time_float]);
			let v2 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierBy_ControlPoint1_vec2f]);
			let v3 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierBy_ControlPoint2_vec2f]);
			let v4 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_BezierBy_EndPoint_vec2f]);
			return cc.bezierBy(v1, [v2, v3, v4]);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_FadeIn, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FadeIn_Time_float]);
			return cc.fadeIn(v1);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_FadeOut, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FadeOut_Time_float]);
			return cc.fadeOut(v1);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_FadeTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FadeTo_Time_float]);
			let v2 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FadeTo_Opacity_int]);
			return cc.fadeTo(v1, v2);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_TintTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_Time_float]);
			let v2 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_R_int]);
			let v3 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_G_int]);
			let v4 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_B_int]);
			return cc.tintTo(v1, v2, v3, v4);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_TintBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_Time_float]);
			let v2 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_R_int]);
			let v3 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_G_int]);
			let v4 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_TintTo_B_int]);
			return cc.tintBy(v1, v2, v3, v4);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Blink, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Blink_Time_float]);
			let v2 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Blink_BlinkCount_int]);
			return cc.blink(v1, v2);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_DelayTime, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_DelayTime_Time_float]);
			return cc.delayTime(v1);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Orbit, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_Radius_float]);
			let v3 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_DeltaRadius_float]);
			let v4 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_ZAngle_float]);
			let v5 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_ZDeltaAngle_float]);
			let v6 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_XAngle_float]);
			let v7 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_Orbit_XDeltaAngle_float]);
			return cc.orbitCamera(v1,v2,v3,v4,v5,v6,v7);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CardinalSplineTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CardinalSplineTo_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CardinalSplineTo_Tension_float]);
			let arrayPoints = [];
			for (let i = ivy.GameActionTypes.AT_ELEMENT_CardinalSplineTo_Point1_vec2f; i <= ivy.GameActionTypes.AT_ELEMENT_CardinalSplineTo_Point10_vec2f; ++i) {
				let v3 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[i]);
				if (v3.x !== -1 && v3.y !== -1) {
					arrayPoints.push(v3)
				}
			}
			let newAction = null;
			if (arrayPoints.length===0) {
				return newAction;
			} else {
				return cc.cardinalSplineTo(v1, arrayPoints, v2);
			}
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CardinalSplineBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CardinalSplineBy_Time_float]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CardinalSplineBy_Tension_float]);
			let arrayPoints = [];
			for (let i = ivy.GameActionTypes.AT_ELEMENT_CardinalSplineBy_Point1_vec2f; i <= ivy.GameActionTypes.AT_ELEMENT_CardinalSplineBy_Point10_vec2f; ++i) {
				let v3 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[i]);
				if (v3.x !== -1 && v3.y !== -1) {
					arrayPoints.push(v3);
				}
			}
			let newAction = null;
			if (arrayPoints.length===0) {
				return newAction;
			} else {
				return cc.cardinalSplineBy(v1, arrayPoints, v2);
			}
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CatmullRomTo, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CatmullRomTo_Time_float]);
			let arrayPoints = [];
			for (let i = ivy.GameActionTypes.AT_ELEMENT_CatmullRomTo_Point1_vec2f; i <= ivy.GameActionTypes.AT_ELEMENT_CatmullRomTo_Point10_vec2f; ++i) {
				let v3 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[i]);
				if (v3.x !== -1 && v3.y !== -1) {
					arrayPoints.push(v3);
				}
			}
			let newAction = null;
			if (arrayPoints.length===0) {
				return newAction;
			} else {
				return cc.catmullRomTo(v1, arrayPoints);
			}
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CatmullRomBy, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CatmullRomBy_Time_float]);
			let arrayPoints = [];
			for (let i = ivy.GameActionTypes.AT_ELEMENT_CatmullRomBy_Point1_vec2f; i <= ivy.GameActionTypes.AT_ELEMENT_CatmullRomBy_Point10_vec2f; ++i) {
				let v3 = cadm.getVec2DataByFindIndex(actionData.propertyDataFindIndex[i]);
				if (v3.x !== -1 && v3.y !== -1) {
					arrayPoints.push(v3);
				}
			}
			let newAction = null;
			if (arrayPoints.length===0) {
				return newAction;
			} else {
				return cc.catmullRomBy(v1, arrayPoints);
			}
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseBounceIn, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeBounceIn());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseBounceOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeBounceOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseBounceInOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeBounceInOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseBackIn, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeBackIn());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseBackOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeBackOut);
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseBackInOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeBackInOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseElasticIn, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeElasticIn());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseElasticOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeElasticOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseElasticInOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeElasticInOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseExponentialIn, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeExponentialIn());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseExponentialOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeExponentialOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseExponentialInOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeExponentialInOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseSineIn, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeSineIn());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseSineOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeSineOut());
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_EaseSineInOut, function(actionData, actionVector) {
			return actionVector[0].easing(cc.easeSineInOut());
		});
		//*
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CustomFunc, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CustomFunc_FuncIndex_list]);
			return cc.callFunc(function() {
				//暫時沒擴展
				ivy.CocosActionCreater.getInstance().callCustomActionFunction(v1);
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_OtherAction, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_OtherAction_ActionIndex_int]);
			return cc.callFunc(function(node) {
				ivy.CocosActionDataManager.getInstance().runActionByNode(node, v1);
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RemoveForm, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_RemoveForm_FormName_string]);
			return cc.callFunc(function() {
				let form = ivy.UIManager.getInstance().getFormByName(v1);
				ivy.UIManager.getInstance().removeExistFormFromMapByName(v1);
				if (form) {
					form.removeFromParent();
				}
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_ChangeMainForm, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_ChangeMainForm_FormName_string]);
			return cc.callFunc(function() {
				ivy.UIManager.getInstance().runWithFormByName(v1);
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RemovePopUpForm, function() {
			return cc.callFunc(function() {
				ivy.UIManager.getInstance().removePopUpForm();
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CallRemovePopUpForm, function() {
			return cc.callFunc(function() {
				ivy.UIManager.getInstance().getTopPopUpForm().runOutAction();
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CreatePopUpForm, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CreatePopUpForm_PopUpFormName_string]);
			return cc.callFunc(function() {
				ivy.UIManager.getInstance().popUpFormByName(v1);
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Hide, function() {
			return cc.callFunc(function(node) {
				node.setVisible(false);
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_Show, function() {
			return cc.callFunc(function(node) {
				node.setVisible(true);
			});
		});

		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_PlaySoundEffect, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_PlaySoundEffect_SoundFilePath_string]);
			let v2 = cadm.getFloatDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_PlaySoundEffect_SoundFrequency_float]);
			return cc.callFunc(function(node) {
				if(node.isVisible())
					ivy.SoundManager.getInstance().playSound(v1);
			});
		});

		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RemoveSelf, function() {
			return cc.removeSelf();
		});

		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_RemovePopUpFormByName, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_RemovePopUpFormByName_FormName_string]);
			return cc.callFunc(function() {
				ivy.UIManager.getInstance().removePopUpFormByName(v1);
			});
		});

		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_CallRemovePopUpFormByName, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_CallRemovePopUpFormByName_FormName_string]);
			return cc.callFunc(function() {
				let form = ivy.UIManager.getInstance().getPopUpForm(v1);
				if (form) {
					form.runOutAction();
				}
			});
		});

		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_PlayMusic, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_PlayMusic_FilePath_string]);
			return cc.callFunc(function(node) {
				if (node.isVisible()) {
					if (v1.length() <= 0)
						ivy.SoundManager.getInstance().setMusicStop();
					else
						ivy.SoundManager.getInstance().playMusic(v1);
				}
			});
		});
		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_UIControlEnableTouch, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_UIControlEnableTouch_IsEnable_list]);
			return cc.callFunc(function(node) {
				if (node instanceof ivy.UIBase) {
					switch (v1) {
						case 0:
							node.setEnableUserTouch(false);
							break;
						case 1:
							node.setEnableUserTouch(true);
							break;
						default:
							//do nothing
							break;
					}
				}
			});
		});

		cadm.registActionCreaterFunc(ivy.GameActionTypes.AT_FindControlPlayOtherAction, function(actionData) {
			let cadm = ivy.CocosActionDataManager.getInstance();
			let v1 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FindControlPlayOtherAction_FindType_list]);
			let v2 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FindControlPlayOtherAction_FormName_string]);
			let v3 = cadm.getStringDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FindControlPlayOtherAction_BlockName_string]);
			let v4 = cadm.getIntDataByFindIndex(actionData.propertyDataFindIndex[ivy.GameActionTypes.AT_ELEMENT_FindControlPlayOtherAction_CallActionIndex_int]);

			return cc.callFunc(function() {
				if (v1 === 0) {
					let form = ivy.UIManager.getInstance().getFormByName(v2);
					if (form) {
						let control = form.getChildByName(v3);
						if (control) {
							ivy.CocosActionDataManager.getInstance().runActionByNode(control, v4);
						}
					}
				} else if (v1 === 1) {
					let form = ivy.UIManager.getInstance().getPopUpForm(v2);
					if (form) {
						let control = form.getChildByName(v3);
						if (control) {
							ivy.CocosActionDataManager.getInstance().runActionByNode(control, v4);
						}
					}
				}
			});
		});
	},
	callCustomActionFunction : function (par) {
		if (this._customActionFunc) {
			this._customActionFunc(par);
		}
	},
	registerCustomActionFunction : function (func) {
		this._customActionFunc = func;
	},
};